/**
 * 
 */
package graph;

import java.util.Collection;



/**
 * An interface for undirected and directed graphs.
 * @author Alex
 *
 */
public interface Graph<V,W> {

	/**
	 * Returns the vertices in this graph.
	 * @return A collection of vertices.
	 */
	Collection<Vertex<V>> getVertices();
	
	/** Returns the edges in this graph
	 * @return A collection of edges.
	 */
	Collection<Edge<V, W>> getEdges();
	
	/**
	 * Adds the specified vertex to the graph.
	 * @param v
	 */
	boolean addVertex(Vertex<V> v);
	
	/**
	 * Adds the specified vertices to the graph.
	 * @param v
	 */
	@SuppressWarnings("rawtypes")
	public boolean addVertex(Vertex vArray[]);
	
	/**
	 * Returns a vertex by String name.
	 * @param name
	 * @return
	 */
	public Vertex<V> getVertex(String name);
	
	/**
	 * Adds the specified edge (and any vertices not already in the graph) to the graph object.
	 * @param e
	 */
	void addEdge(Edge<V,W> e);
	
	/**
	 * Returns true if this graph has an edge connecting the two vertices specified.
	 * @param v1
	 * @param v2
	 * @return
	 */
	boolean hasEdge(Vertex<V> v1, Vertex<V> v2);
	
	/**
	 * 
	 * @return The number of edges in the graph.
	 */
	int getEdgeCount();
	
	/**
	 * 
	 * @return The number of vertices in the graph.
	 */
	int getVertexCount();

}
